package com.ikkong.system.meta.intercept;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;

import java.util.logging.Logger;

/**
 * 记录日志
 * 
 * @author ikkong
 *
 */
public class GlobalActionInterceptor implements Interceptor {
	static Logger logger = Logger.getLogger("GlobalActionInterceptor");// 一般为当前的类名

	public void intercept(Invocation inv) {

		Controller controller = inv.getController();
		controller.getResponse().setHeader("Access-Control-Allow-Origin", "*");
		controller.getResponse().setHeader("Access-Control-Allow-Headers", "*");
//		controller.getResponse().setHeader("Access-Control-Allow-Credentials", "true");
        inv.invoke();
	}
}
